<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOpenScreenTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_screen', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title',100)->notNull()->comment('标题');
            $table->string('hit_type',100)->notNull()->comment('命中类型');
            $table->string('hit_content',20)->notNull()->comment('命中内容');
            $table->string('thumb',60)->notNull()->comment('图片链接');
            $table->integer('weight')->notNull()->comment('权重');
            $table->integer('second')->notNull()->comment('显示时间');
            $table->timestamp('start_time')->default(\DB::raw('CURRENT_TIMESTAMP'))->comment('开始时间');
            $table->timestamp('end_time')->default(\DB::raw('CURRENT_TIMESTAMP'))->comment('结束时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_screen');
    }
}
